package edu.pitt.dbmi.odie.gapp.gwt.client.analysis.datasource;

import java.util.Date;

import com.google.gwt.user.client.rpc.IsSerializable;
import com.smartgwt.client.widgets.grid.ListGridRecord;

public class ODIE_AnalysisRecord extends ListGridRecord implements IsSerializable {
	
	public ODIE_AnalysisRecord() {
	}
	
	public ODIE_AnalysisRecord(String odieId, String userId, String title,
			String analysisStatus, Date creationDate, Date modifiedDate,
			int unitsRequested, int unitsCompleted, String processingUnitName) {
		setOdieId(odieId);
		setUserId(userId);
		setTitle(title);
		setAnalysisStatus(analysisStatus);
		setCreationDate(creationDate);
		setModifiedDate(modifiedDate);
		setUnitsRequested(unitsRequested);
		setUnitsCompleted(unitsCompleted);
		setProcessingUnitName(processingUnitName);
	}

	public void setOdieId(String odieId) {
		setAttribute("odieId", odieId);
	}

	public void setUserId(String userId) {
		setAttribute("userId", userId);
	}

	public void setTitle(String title) {
		setAttribute("title", title);
	}

	public void setAnalysisStatus(String analysisStatus) {
		setAttribute("analysisStatus", analysisStatus);
	}

	public void setCreationDate(Date creationDate) {
		setAttribute("creationDate", creationDate);
	}

	public void setModifiedDate(Date modifiedDate) {
		setAttribute("modifiedDate", modifiedDate);
	}

	public void setUnitsRequested(int unitsRequested) {
		setAttribute("unitsRequested", unitsRequested);
	}

	public void setUnitsCompleted(int unitsCompleted) {
		setAttribute("unitsCompleted", unitsCompleted);
	}

	public void setProcessingUnitName(String processingUnitName) {
		setAttribute("processingUnitName", processingUnitName);
	}
	
	public String getOdieId() {
		return getAttributeAsString("odieId");
	}

	public String getUserId() {
		return getAttributeAsString("userId");
	}

	public String getTitle() {
		return getAttributeAsString("title");
	}

	public String getAnalysisStatus() {
		return getAttributeAsString("analysisStatus");
	}

	public Date getCreationDate() {
		return getAttributeAsDate("creationDate");
	}

	public Date getModifiedDate() {
		return getAttributeAsDate("modifiedDate");
	}

	public int getUnitsRequested() {
		return getAttributeAsInt("unitsRequested");
	}

	public int getUnitsCompleted() {
		return getAttributeAsInt("unitsCompleted");
	}

	public String getProcessingUnitName() {
		return getAttributeAsString("processingUnitName");
	}
	
	public String getProgress() {
		return getAttributeAsString("progress") ;
	}

	public void setBackground(String background) {
		setAttribute("background", background);
	}

	public String getBackground() {
		return getAttributeAsString("background");
	}

	public String getFieldValue(String field) {
		return getAttributeAsString(field);
	}

}